Attribute Suite v.1.2.3

by Kiril Nedelchev <kikoleppard@hotmail.bg>

 

Manual installation

STEP 1. Add new fields to db

ALTER TABLE products_options
ADD products_options_unique_name VARCHAR( 80 ) DEFAULT NULL ,
ADD products_options_type INT( 5 ) NOT NULL ,
ADD products_options_length SMALLINT( 2 ) DEFAULT '32' NOT NULL ,
ADD products_options_comment VARCHAR( 80 ) DEFAULT NULL ,
ADD products_options_link VARCHAR( 80 ) DEFAULT NULL ;

ALTER TABLE products_attributes
ADD products_options_sort_order int(6) NOT NULL default '0' AFTER price_prefix;

ALTER TABLE customers_basket_attributes
ADD products_options_value_text text ;

INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES (0, 1, 'TEXT');
INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES (0, 2, 'TEXT');
INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES (0, 3, 'TEXT');

ALTER TABLE products_options_values
ADD products_options_values_sort_order int(6) NOT NULL default '0' AFTER products_options_values_name;

 

STEP 2. Copy and paste

the code from configure.php, NOT THE FILE. Must paste in /catalog /includes/configure.php

/Attribute suite start
//unique attribute
define('DIR_WS_DETAILS', 'details/');
//unique attribute

// CLR 020605 defines needed for Product Option Type feature.
define('PRODUCTS_OPTIONS_TYPE_SELECT', 0);
define('PRODUCTS_OPTIONS_TYPE_TEXT', 1);
define('PRODUCTS_OPTIONS_TYPE_RADIO', 2);
define('PRODUCTS_OPTIONS_TYPE_CHECKBOX', 3);

define('TEXT_PREFIX', 'txt_');
define('PRODUCTS_OPTIONS_VALUE_TEXT_ID', 0); //Must match id for user defined "TEXT" value in db table TABLE_PRODUCTS_OPTIONS_VALUES
//Attribute suite end

 

STEP 3. Create a folder

catalog/details

 

STEP 4. Upload the provided images/button_edit_attributes.gif

to the directory: admin/includes/languages/images/buttons/

STEP 5. Add the new files

Admin module

catalog/admin/new_single_attribute.php
catalog/admin/new_single_attribute_select.php
catalog/admin/new_single_attribute_change.php
catalog/admin/new_single_attribute_include.php
catalog/admin/new_attributes.php
catalog/admin/new_attributes_include.php
catalog/admin/new_attributes_change.php
catalog/admin/new_attributes_select.php
catalog/admin/new_attributes_functions.php
catalog/admin/new_attributes_config.php
catalog/admin/product_options.php
catalog/admin/option_values.php
catalog/admin/quick_products_popup.php
catalog/admin/quick_attributes_popup.php
catalog/admin/includes/functions/webmakers_added_functions.php
catalog/admin/includes/javascript/webmakers_added_js.php

catalog/admin/includes/languages/english/new_single_attribute.php
catalog/admin/includes/languages/english/new_attribute_manager.php
catalog/admin/includes/languages/english/option_values.php
catalog/admin/includes/languages/english/product_options.php
catalog/admin/includes/languages/english/attribute_sorter_copier.php

For full multilanguage compatibility change this code in new_attributes.php and new_single_attribute.php

$adminImages = "includes/languages/english/images/buttons/";

in

$adminImages = "includes/languages/YourLanguage/images/buttons/";

VERY IMPORTANT !!!
in catalog/admin/new_attributes_config.php
// Change to your default language ID if it differs. English is set by default
$languageFilter = "1";

STEP 6. In admin/categories.php

after:

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $new_parent_id . '&pID=' . $products_id)); break;

add this:

//Attribute Suite start

///////////////////////////////////////////////////////////////////////////////////////
// BOF: WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
case 'create_copy_product_attributes':
// $products_id_to= $copy_to_products_id;
// $products_id_from = $pID;
tep_copy_products_attributes($pID,$copy_to_products_id);
break;
// EOF: WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
// WebMakers.com Added: Copy Attributes Existing Product to All Existing Products in a Category
case 'create_copy_product_attributes_categories':
// $products_id_to= $categories_products_copying['products_id'];
// $products_id_from = $make_copy_from_products_id;
// echo 'Copy from products_id# ' . $make_copy_from_products_id . ' Copy to all products in category: ' . $cID . '<br>';
$categories_products_copying_query= tep_db_query("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $cID . "'");
while ( $categories_products_copying=tep_db_fetch_array($categories_products_copying_query) ) {
// process all products in category
tep_copy_products_attributes($make_copy_from_products_id,$categories_products_copying['products_id']);
}
break;
// EOF: WebMakers.com Added: Copy Attributes Existing Product to All Existing Products in a Category
///////////////////////////////////////////////////////////////////////////////////////

//Attribute Suite end

after:

} elseif ($action == 'update_product') {
tep_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'");
}
}

add this:
//Attribute Suite start

/////////////////////////////////////////////////////////////////////
// BOF: WebMakers.com Added: Update Product Attributes and Sort Order
// Update the changes to the attributes if any changes were made
// Update Product Attributes
$rows = 0;
$options_query = tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . $languages_id . "' order by products_options_name");
while ($options = tep_db_fetch_array($options_query)) {
$values_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " p2p where pov.products_options_values_id = p2p.products_options_values_id and p2p.products_options_id = '" . $options['products_options_id'] . "' and pov.language_id = '" . $languages_id . "' order by pov.products_options_values_name");
while ($values = tep_db_fetch_array($values_query)) {
$rows ++;
// original $attributes_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $products_id . "' and options_id = '" . $options['products_options_id'] . "' and options_values_id = '" . $values['products_options_values_id'] . "'");
$attributes_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix, products_options_sort_order from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $products_id . "' and options_id = '" . $options['products_options_id'] . "' and options_values_id = '" . $values['products_options_values_id'] . "'");
if (tep_db_num_rows($attributes_query) > 0) {
$attributes = tep_db_fetch_array($attributes_query);
if ($HTTP_POST_VARS['option'][$rows]) {
if ( ($HTTP_POST_VARS['prefix'][$rows] <> $attributes['price_prefix']) || ($HTTP_POST_VARS['price'][$rows] <> $attributes['options_values_price']) || ($HTTP_POST_VARS['products_options_sort_order'][$rows] <> $attributes['products_options_sort_order']) ) {
if (!isset($HTTP_POST_VARS['products_options_sort_order'][$rows]) || (isset($HTTP_POST_VARS['products_options_sort_order'][$rows]) && $HTTP_POST_VARS['products_options_sort_order'][$rows] == '' )) {
$lookup = tep_db_query("select products_options_values_sort_order from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " WHERE products_options_values_id ='" . $values['products_options_values_id'] . "'");
$lookup_res = tep_db_fetch_array($lookup);
$att_sort_order = $lookup_res['products_options_values_sort_order'];
} else {
$att_sort_order = $HTTP_POST_VARS['products_options_sort_order'][$rows];
}
tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set options_values_price = '" . $HTTP_POST_VARS['price'][$rows] . "', price_prefix = '" . $HTTP_POST_VARS['prefix'][$rows] . "', products_options_sort_order = '" . $att_sort_order ."' where products_attributes_id = '" . $attributes['products_attributes_id'] . "'");
}
} else {
tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_attributes_id = '" . $attributes['products_attributes_id'] . "'");
}
} elseif ($HTTP_POST_VARS['option'][$rows]) {
if (!isset($HTTP_POST_VARS['products_options_sort_order'][$rows]) || (isset($HTTP_POST_VARS['products_options_sort_order'][$rows]) && $HTTP_POST_VARS['products_options_sort_order'][$rows] == '' )) {
$lookup = tep_db_query("select products_options_values_sort_order from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " WHERE products_options_values_id ='" . $values['products_options_values_id'] . "'");
$lookup_res = tep_db_fetch_array($lookup);
$att_sort_order = $lookup_res['products_options_values_sort_order'];
} else {
$att_sort_order = $HTTP_POST_VARS['products_options_sort_order'][$rows];
}

tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $products_id . "', '" . $options['products_options_id'] . "', '" . $values['products_options_values_id'] . "', '" . $HTTP_POST_VARS['price'][$rows] . "', '" . $HTTP_POST_VARS['prefix'][$rows] . "', '" . $att_sort_order . "')");
}
}
}
// EOF: WebMakers.com Added: Update Product Attributes and Sort Order
/////////////////////////////////////////////////////////////////////

//Attribute Suite end

find:
tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");
$products_id = $dup_products_id;
}

and replace with:

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");
//Attribute Suite start
// BOF: WebMakers.com Added: Attributes Copy on non-linked
$products_id_from=tep_db_input($products_id);
$products_id_to= $dup_products_id;
$products_id = $dup_products_id;
if ( $HTTP_POST_VARS['copy_attributes']=='copy_attributes_yes' and $HTTP_POST_VARS['copy_as'] == 'duplicate' ) {

// WebMakers.com Added: Copy attributes to duplicate product
// $products_id_to= $copy_to_products_id;
// $products_id_from = $pID;

$copy_attributes_delete_first='1';
$copy_attributes_duplicates_skipped='1';
$copy_attributes_duplicates_overwrite='0';

if (DOWNLOAD_ENABLED == 'true') {
$copy_attributes_include_downloads='1';
$copy_attributes_include_filename='1';
} else {
$copy_attributes_include_downloads='0';
$copy_attributes_include_filename='0';
}
tep_copy_products_attributes($products_id_from,$products_id_to);

}
}
// EOF: WebMakers.com Added: Attributes Copy on non-linked

//Attribute Suite end

after:


} else {
$messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
}
?>

add this:

<?php

//Attribute Suite start

/* BOF: Attributes sort/copy (afaik, this doesn't do anything) */
// WebMakers.com Added: Display Order
switch (true) {
case (CATEGORIES_SORT_ORDER=="products_name"):
$order_it_by = "pd.products_name";
break;
case (CATEGORIES_SORT_ORDER=="products_name-desc"):
$order_it_by = "pd.products_name DESC";
break;
case (CATEGORIES_SORT_ORDER=="model"):
$order_it_by = "p.products_model";
break;
case (CATEGORIES_SORT_ORDER=="model-desc"):
$order_it_by = "p.products_model DESC";
break;
default:
$order_it_by = "pd.products_name";
break;
}
/* EOF: Attributes sort/copy */

//Attribute Suite end
?>

after:

<script language="javascript" src="includes/general.js"></script>

add this:

//Attribute Suite start

/* BOF: Attributes sort/copy */
// WebMakers.com Added: Java Scripts
include(DIR_WS_INCLUDES . 'javascript/' . 'webmakers_added_js.php')
/* EOF: Attributes sort/copy */

//Attribute Suite end

after:


<td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_input_field('products_weight', $pInfo->products_weight); ?></td>
</tr>
</table></td>
</tr>

add this:

//Attribute Suite start

/////////////////////////////////////////////////////////////////////
// BOF: WebMakers.com Added: Draw Attribute Tables
?>
<tr>
<td><table border="3" cellspacing="5" cellpadding="2" align="center" bgcolor="000000">
<?php
$rows = 0;
$options_query = tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . $languages_id . "' order by products_options_name");
while ($options = tep_db_fetch_array($options_query)) {
$values_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " p2p where pov.products_options_values_id = p2p.products_options_values_id and p2p.products_options_id = '" . $options['products_options_id'] . "' and pov.language_id = '" . $languages_id . "' order by pov.products_options_values_name");
$header = false;
while ($values = tep_db_fetch_array($values_query)) {
$rows ++;
if (!$header) {
$header = true;
?>
<tr valign="top">
<td><table border="2" cellpadding="2" cellspacing="2" bgcolor="FFFFFF">
<tr class="dataTableHeadingRow">
<td colspan="4" class="attributeBoxContent" align="center"><?php echo TEXT_ACTIVE_ATTRIBUTES ; ?></td>
</tr>
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" width="250" align="left"><?php echo $options['products_options_name']; ?></td>
<td class="dataTableHeadingContent" width="50" align="center"><?php echo TEXT_PREFIX ; ?></td>
<td class="dataTableHeadingContent" width="70" align="center"><?php echo TEXT_PRICE ; ?></td>
<td class="dataTableHeadingContent" width="70" align="center"><?php echo TEXT_SORT_ORDER ; ?></td>
</tr>
<?php
}
$attributes = array();
if (sizeof($HTTP_POST_VARS) > 0) {
if ($HTTP_POST_VARS['option'][$rows]) {
$attributes = array(
'products_attributes_id' => $HTTP_POST_VARS['option'][$rows],
'options_values_price' => $HTTP_POST_VARS['price'][$rows],
'price_prefix' => $HTTP_POST_VARS['prefix'][$rows],
'products_options_sort_order' => $HTTP_POST_VARS['products_options_sort_order'][$rows],
);
}
} else {
$attributes_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix, products_options_sort_order from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $pInfo->products_id . "' and options_id = '" . $options['products_options_id'] . "' and options_values_id = '" . $values['products_options_values_id'] . "'");
if (tep_db_num_rows($attributes_query) > 0) {
$attributes = tep_db_fetch_array($attributes_query);
}
}
?>
<tr class="dataTableRow">
<td class="dataTableContent"><?php echo tep_draw_checkbox_field('option[' . $rows . ']', $attributes['products_attributes_id'], $attributes['products_attributes_id']) . '&nbsp;' . $values['products_options_values_name']; ?>&nbsp;</td>
<td class="dataTableContent" width="50" align="center"><?php echo tep_draw_input_field('prefix[' . $rows . ']', $attributes['price_prefix'], 'size="2"'); ?></td>
<td class="dataTableContent" width="70" align="center"><?php echo tep_draw_input_field('price[' . $rows . ']', $attributes['options_values_price'], 'size="7"'); ?></td>
<td class="dataTableContent" width="70" align="center"><?php echo tep_draw_input_field('products_options_sort_order[' . $rows . ']', $attributes['products_options_sort_order'], 'size="7"'); ?></td>
</tr>
<?php
}
if ($header) {
?>
</table></td>
<?php
}
}
?>
</tr>
</table></td>
</tr>
<?php
// EOF: WebMakers.com Added: Draw Attribute Tables
/////////////////////////////////////////////////////////////////////

//Attribute Suite end


find:

/* Re-Post all POST'ed variables */
reset($HTTP_POST_VARS);
while (list($key, $value) = each($HTTP_POST_VARS)) {
if (!is_array($HTTP_POST_VARS[$key])) {
echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
}
}
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));
echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));
echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));
}

and replace with:

//Attribute Suite start

/////////////////////////////////////////////////////////////////////
// BOF: WebMakers.com Added: Original Code No longer used
// Code has been left in to show how additional products_descriptions could be added
if (false) {
/* Re-Post all POST'ed variables */
reset($HTTP_POST_VARS);
while (list($key, $value) = each($HTTP_POST_VARS)) {
if (!is_array($HTTP_POST_VARS[$key])) {
echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
}
}
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));
echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));
echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));
}
} // false
// WebMakers.com Added: Original Code
/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////
// WebMakers.com Added: Modified to include Attributes Code
/* Re-Post all POST'ed variables */
reset($HTTP_POST_VARS);
while (list($key, $value) = each($HTTP_POST_VARS)) {
if (is_array($value)) {
while (list($k, $v) = each($value)) {
echo tep_draw_hidden_field($key . '[' . $k . ']', htmlspecialchars(stripslashes($v)));
}
} else {
echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
}
}
// EOF: WebMakers.com Added: Modified to include Attributes Code
/////////////////////////////////////////////////////////////////////

//Attribute Suite end

find:

$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
break;

and replace with:

//Attribute Suite start

// BOF: Attributes copy
// WebMakers.com Added: Attributes Copy
$contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
$contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES_ONLY );
$contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES . '<br>' . tep_draw_radio_field('copy_attributes', 'copy_attributes_yes', true) . ' ' . TEXT_COPY_ATTRIBUTES_YES . '<br>' . tep_draw_radio_field('copy_attributes', 'copy_attributes_no') . ' ' . TEXT_COPY_ATTRIBUTES_NO);
$contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '10'));
$contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
// WebMakers.com Added: Attributes Copy

 

$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
break;

// WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
case 'copy_product_attributes':
$copy_attributes_delete_first='1';
$copy_attributes_duplicates_skipped='1';
$copy_attributes_duplicates_overwrite='0';

if (DOWNLOAD_ENABLED == 'true') {
$copy_attributes_include_downloads='1';
$copy_attributes_include_filename='1';
} else {
$copy_attributes_include_downloads='0';
$copy_attributes_include_filename='0';
}

$heading[] = array('text' => '<b>' . TEXT_COPY_ATTRIBUTES_TO_ANOTHER_PRODUCT . '</b>');
$contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=create_copy_product_attributes&cPath=' . $cPath . '&pID=' . $pInfo->products_id) . tep_draw_hidden_field('products_id', $pInfo->products_id) . tep_draw_hidden_field('products_name', $pInfo->products_name));
$contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES_FROM . $pInfo->products_id . '<br><b>' . $pInfo->products_name . '</b>');
$contents[] = array('text' => TEXT_COPY_ATTRIBUTES_TO . '&nbsp;' . tep_draw_input_field('copy_to_products_id', $copy_to_products_id, 'size="3"'));
$contents[] = array('text' => '<br>' . TEXT_DELETE_ATTRIBUTES_AND_DOWNLOADS . '&nbsp;' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size="2"'));
$contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
$contents[] = array('text' => '<br>' . TEXT_OTHERWISE );
$contents[] = array('text' => TEXT_DUPLICATE_ATTRIBUTES_SKIPPED . '&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
$contents[] = array('text' => '&nbsp;&nbsp;&nbsp;' . TEXT_DUPLICATE_ATTRIBUTES_OVERWRITTEN . '&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size="2"'));
if (DOWNLOAD_ENABLED == 'true') {
$contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES_WITH_DOWNLOADS . '&nbsp;' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size="2"'));
// Not used at this time - download name copies if download attribute is copied
// $contents[] = array('text' => '&nbsp;&nbsp;&nbsp;Include Download Filenames&nbsp;' . tep_draw_checkbox_field('copy_attributes_include_filename',$copy_attributes_include_filename, 'size="2"'));
}
$contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
$contents[] = array('align' => 'center', 'text' => '<br>' . PRODUCT_NAMES_HELPER);
if ($pID) {
$contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER);
} else {
$contents[] = array('align' => 'center', 'text' => '<br>' . TEXT_SELECT_PRODUCT_DISPLAY );
}
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', TEXT_COPY_ATTRIBUTES) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
break;
// WebMakers.com Added: Copy Attributes Existing Product to All Products in Category
case 'copy_product_attributes_categories':
$copy_attributes_delete_first='1';
$copy_attributes_duplicates_skipped='1';
$copy_attributes_duplicates_overwrite='0';

if (DOWNLOAD_ENABLED == 'true') {
$copy_attributes_include_downloads='1';
$copy_attributes_include_filename='1';
} else {
$copy_attributes_include_downloads='0';
$copy_attributes_include_filename='0';
}
$heading[] = array('text' => '<b>' . TEXT_COPY_ATTRIBUTES_TO_CATEGORY . '</b>');
$contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=create_copy_product_attributes_categories&cPath=' . $cPath . '&cID=' . $cID . '&make_copy_from_products_id=' . $copy_from_products_id));
$contents[] = array('text' => TEXT_COPY_ATTRIBUTES_FROM_PRODUCT_ID . '&nbsp;' . tep_draw_input_field('make_copy_from_products_id', $make_copy_from_products_id, 'size="3"'));
$contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES_IN_CATEGORY_ID . '&nbsp;' . $cID . '<br>' . TEXT_CATEGORY_NAME . '<b>' . tep_get_category_name($cID, $languages_id) . '</b>');
$contents[] = array('text' => '<br>' . TEXT_DELETE_ATTRIBUTES_AND_DOWNLOADS . '&nbsp;' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size="2"'));
$contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
$contents[] = array('text' => '<br>' . TEXT_OTHERWISE);
$contents[] = array('text' => TEXT_DUPLICATE_ATTRIBUTES_SKIPPED . '&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
$contents[] = array('text' => '&nbsp;&nbsp;&nbsp;' . TEXT_DUPLICATE_ATTRIBUTES_OVERWRITTEN . '&nbsp;' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size="2"'));
if (DOWNLOAD_ENABLED == 'true') {
$contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES_WITH_DOWNLOADS . '&nbsp;' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size="2"'));
// Not used at this time - download name copies if download attribute is copied
// $contents[] = array('text' => '&nbsp;&nbsp;&nbsp;Include Download Filenames&nbsp;' . tep_draw_checkbox_field('copy_attributes_include_filename',$copy_attributes_include_filename, 'size="2"'));
}
$contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
$contents[] = array('align' => 'center', 'text' => '<br>' . PRODUCT_NAMES_HELPER);
$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', TEXT_COPY_ATTRIBUTES) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cID) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
break;
// EOF: Attributes copy

//Attribute Suite end


find:

} elseif (isset($pInfo) && is_object($pInfo)) { // product info box contents
$heading[] = array('text' => '<b>' . tep_get_products_name($pInfo->products_id, $languages_id) . '</b>');

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_product') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');

and replace with:


//Attribute Suite start

//BOF: Attributes copy to all existing products
if ($cInfo->childs_count==0 and $cInfo->products_count >= 1) {
// WebMakers.com Added: Copy Attributes Existing Product to All Existing Products in Category
$contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
if ($cID) {
$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cID . '&action=copy_product_attributes_categories') . '">' . TEXT_COPY_ATTRIBUTES_TO . '<br>' . TEXT_ALL_PRODUCTS_CATEGORY . tep_get_category_name($cID, $languages_id) . '<br>' . tep_image_button('button_copy_to.gif', TEXT_COPY_ATTRIBUTES) . '</a>');
} else {
$contents[] = array('align' => 'center', 'text' => '<br>' . TEXT_SELECT_CATEGORY_COPY_ATTRIBUTES );
}
}
// Attributes copy to all existing products

} elseif (isset($pInfo) && is_object($pInfo)) { // product info box contents
$heading[] = array('text' => '<b>' . tep_get_products_name($pInfo->products_id, $languages_id) . '</b>');

// Line Change - Added link for Attribute Manager - MG
$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_product') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a><a href="./new_attributes.php?action=select&current_product_id=' . $pInfo->products_id . '&cPath=' . $cPath . '">' . tep_image_button('button_edit_attributes.gif', IMAGE_EDIT_ATTRIBUTES) . '</A>');
// Line Change - Added link for Attribute Manager - MG
//Attribute suite end



after:


$contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);
$contents[] = array('text' => '<br>' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%');

add this:


//Attribute Suite start

// BOF: Attributes copy existing to existing
// WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
$contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_product_attributes') . '">' . TEXT_PRODUCTS_ATTRIBUTES_COPIER . '<br>' . tep_image_button('button_copy_to.gif', TEXT_COPY_ATTRIBUTES) . '</a>');
if ($pID) {
$contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '10'));
} else {
$contents[] = array('align' => 'center', 'text' => '<br>' . TEXT_SELECT_PRODUCT_DISPLAY_ATTRIBUTES );
}
//EOF: Attributes copy existing to existing

//Attribute Suite end



STEP 7. Add this in admin/includes/filenames.php

//Attribute suite start
// unique attributes
define('FILENAME_PRODUCT_OPTIONS', 'product_options.php');
define('FILENAME_OPTION_VALUES', 'option_values.php');
// unique attributes

//KIKOLEPPARD New attribute manager start
define('FILENAME_NEW_ATTRIBUTE_MANAGER', 'new_attribute_manager.php');
//KIKOLEPPARD New attribute manager start

//KIKOLEPPARD New single attribute manager start
define('FILENAME_NEW_SINGLE_ATTRIBUTE', 'new_single_attribute.php');
//KIKOLEPPARD New single attribute manager start
//Attribute suite end

 

STEP 8. Add this in admin/includes/languages/english.php

//Attribute suite start
// unique attributes
define('BOX_CATALOG_CATEGORIES_PRODUCT_OPTIONS', 'Product Options');
define('BOX_CATALOG_CATEGORIES_OPTION_VALUES', 'Option Values');
// unique attributes

// KIKOLEPPARD New attribute manager start
define('BOX_CATALOG_CATEGORIES_ATTRIBUTE_MANAGER', 'Attribute Manager');
// KIKOLEPPARD New attribute manager end

// KIKOLEPPARD New single attribute manager start
define('BOX_CATALOG_CATEGORIES_SINGLE_ATTRIBUTE', 'Single Attribute');
// KIKOLEPPARD New single attribute manager end

// WebMakers.com Added: Attribute Sorter, Copier and Catalog additions
require(DIR_WS_LANGUAGES . $language . '/' . 'attribute_sorter_copier.php');

define('IMAGE_EDIT_ATTRIBUTES', 'Edit Attributes');

//Attribute suite end


STEP 9. In admin/includes/functions/general.php:

Find:

function tep_options_name($options_id) {
global $languages_id;

$options = tep_db_query("select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$options_id . "' and language_id = '" . (int)$languages_id . "'");
$options_values = tep_db_fetch_array($options);

return $options_values['products_options_name'];
}
Add after:

//Attribute suite start
// unique attributes
function tep_options_unique_name($options_id) {
global $languages_id;

$options = tep_db_query("select products_options_unique_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$options_id . "' and language_id = '" . (int)$languages_id . "'");
$options_values = tep_db_fetch_array($options);

return $options_values['products_options_unique_name'];
}
// unique attributes

//Attribute suite end

 

STEP 10. In admin/includes/boxes/catalog.php:

Find:

'<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .

And replace with

//Attribute suite start
// unique attributes
'<a href="' . tep_href_link(FILENAME_PRODUCT_OPTIONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCT_OPTIONS . '</a><br>' .
'<a href="' . tep_href_link(FILENAME_OPTION_VALUES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_OPTION_VALUES . '</a><br>' .
// unique attributes

//KIKOLEPPARD New Atrributes manager change
'<a href="' . tep_href_link('new_attributes.php', '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_ATTRIBUTE_MANAGER . '</a><br>' .
'<a href="' . tep_href_link('new_single_attribute.php', '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_SINGLE_ATTRIBUTE . '</a><br>' .
//KIKOLEPPARD New Atrributes manager change
//Uncoment for // unique attributes '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .
//Attribute suite end


STEP 11. Add this in admin/includes/application_top.php


//Attribute Suite start
/* BOF: Attributes Sort/Copy */
// WebMakers.com Added: Includes Functions for Attribute Sorter and Copier
require(DIR_WS_FUNCTIONS . 'webmakers_added_functions.php');
/* EOF: Attributes Sort/Copy */
//Attribute Suite end


STEP 12.I n admin/includes/header.php


find:

</table>

and replace with:

<?php

//Attribute Suite start
// BOF: WebMakers.com Added: Quick Return to Catalog
if (!tep_session_is_registered('go_back_to')) {
tep_session_register('go_back_to');
$go_back_to=$REQUEST_URI;
}

if (!strstr($PHP_SELF,FILENAME_CATEGORIES)) {
?>
<tr>
<td class="main" colspan="2" align="right"><?php echo '<FONT COLOR="FF0000"><b>Go Back to:</b></FONT>&nbsp;<a href="' . HTTP_SERVER . $go_back_to . '">' . 'Categories/Products' . '</a>&nbsp;&nbsp;'; ?></td>
</tr>
</table>
<?php
}
// EOF: WebMakers.com Added: Quick Return to Catalog
//Attribute Suite end
?>

Clients module

 

STEP 11. In catalog/product_reviews_write.php

 

Find:
<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

and replace with:

<!-- //Attribute suite start -->
<!--<td class="pageHeading" align="right" valign="top"><?php //HIDE PRICE IF ZERO echo $products_price; ?></td>-->
<!-- Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution) -->
<td class="pageHeading" align="right" valign="top"><?php echo (($product_info['products_price'] > 0) ? $products_price : ''); ?></td>
<!-- End "Hide Price if $0" edit 1 of 2 -->
<!-- //Attribute suite end -->

STEP 12. In catalog/product_reviews_info.php

Find:

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

and replace with:

<!-- //Attribute suite start -->
<!--<td class="pageHeading" align="right" valign="top"><?php //echo $products_price; ?></td>-->
<!-- Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution) -->
<td class="pageHeading" align="right" valign="top"><?php echo (($review['products_price'] > 0) ? $products_price : ''); ?></td>
<!-- End "Hide Price if $0" edit 1 of 2 -->
<!-- //Attribute suite end -->

STEP 13. In catalog/product_new.php

Find:

$products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']));

and replace with:

//Attribute suite start
//$products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id']));
// Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution)
$products_price = (($products_new['products_price'] > 0) ? $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) : '');
// End "Hide Price if $0" edit 1 of 2
//Attribute suite end

 

STEP 14. In catalog/product_reviews.php

Find:

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

and replace with:

<!-- //Attribute suite start -->
<!--<td class="pageHeading" align="right" valign="top"><?php //HIDE PRICE IF ZERO echo $products_price; ?></td>-->
<!-- Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution) -->
<td class="pageHeading" align="right" valign="top"><?php echo (($product_info['products_price'] > 0) ? $products_price : ''); ?></td>
<!-- End "Hide Price if $0" edit 1 of 2 -->
<!-- //Attribute suite end -->

 

STEP 15. In catalog/checkout_process.php

after:

$attributes = tep_db_query($attributes_query);
} else {
$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
}
$attributes_values = tep_db_fetch_array($attributes);

add this:

//Attribute suite start
//clr 030714 update insert query. changing to use values form $order->products for products_options_values.
$sql_data_array = array('orders_id' => $insert_id,
//Attribute suite end

after:

'orders_products_id' => $order_products_id,
'products_options' => $attributes_values['products_options_name'],

add this:

//Attribute suite start
'products_options_values' => $order->products[$i]['attributes'][$j]['value'],

//Attribute suite start

and after:

'download_maxdays' => $attributes_values['products_attributes_maxdays'],
'download_count' => $attributes_values['products_attributes_maxcount']);
tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);
}


add this:

//Attribute suite start
//clr 030714 changing to use values from $orders->products and adding call to tep_decode_specialchars()
$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . tep_decode_specialchars($order->products[$i]['attributes'][$j]['value']);
//$products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];
//Attribute suite end

 

STEP 15. In catalog/shoping_cart.php

find this:

echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);

and replace with:

//Attribute suite start
//clr 030714 move hidden field to if statement below
//echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
//Attribute suite end

after:

and popt.language_id = '" . $languages_id . "'
and poval.language_id = '" . $languages_id . "'");
$attributes_values = tep_db_fetch_array($attributes);

add this:

//Attribute suite start
//clr 030714 determine if attribute is a text attribute and assign to $attr_value temporarily
if ($value == PRODUCTS_OPTIONS_VALUE_TEXT_ID) {
echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . TEXT_PREFIX . $option . ']', $products[$i]['attributes_values'][$option]);
$attr_value = $products[$i]['attributes_values'][$option];
} else {
echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value);
$attr_value = $attributes_values['products_options_values_name'];
}
//Attribute suite end

and
after:

$products[$i][$option]['products_options_name'] = $attributes_values['products_options_name'];
$products[$i][$option]['options_values_id'] = $value;


add this:

//Attribute suite start
//clr 030714 assign $attr_value
$products[$i][$option]['products_options_values_name'] = $attr_value ;
//Attribute suite end

STEP 16. In catalog/product_info.php

after:

function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}

add this:

//Attribute suite start
// Unique attributes
function popupDetailsWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=450,screenX=150,screenY=150,top=150,left=150')
}
// Unique attributes
//Attribute suite end

find:
<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

and replace with:

<!-- //Attribute suite start -->
<!--<td class="pageHeading" align="right" valign="top"><?php //HIDE PRICE IF ZERO echo $products_price; ?></td>-->
<!-- Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution) -->
<td class="pageHeading" align="right" valign="top"><?php echo (($product_info['products_price'] > 0) ? $products_price : ''); ?></td>
<!-- End "Hide Price if $0" edit 1 of 2 -->
<!-- //Attribute suite end -->

find:

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
$products_options_array = array();
$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
while ($products_options = tep_db_fetch_array($products_options_query)) {
$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
if ($products_options['options_values_price'] != '0') {

and replace with:

//Attribute suite start
// Unique attributes
$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment, popt.products_options_link from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' by popt.products_options_sort_order");
// Unique attributes

while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {

//clr 030714 add case statement to check option type
switch ($products_options_name['products_options_type']) {
case PRODUCTS_OPTIONS_TYPE_TEXT:
//CLR 030714 Add logic for text option
$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . /*KIKOLEPPARD add for Product Attribute Sort */"' order by products_options_sort_order"/*KIKOLEPPARD add for Product Attribute Sort */);
$products_attribs_array = tep_db_fetch_array($products_attribs_query);
$tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'"> ' ;

//KIKOLEPPARD change for Actual Attribute Price
if (($products_attribs_array['options_values_price'] != '0')||(($products_attribs_array['options_values_price'] == '0')&&($products_attribs_array['price_prefix'] == ''))){
//KIKOLEPPARD change for Actual Attribute Price

$tmp_html .= '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')';

}
?>
<tr>
<td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
<td class="main"><?php echo $tmp_html;

//KIKOLEPPARD add for Unique Attribute
if ( $products_options_name['products_options_link'] != "" ) {
$link = DIR_WS_DETAILS . $products_options_name['products_options_link'];
if ( $products_options_name['products_options_comment'] != "" ) {
echo '&nbsp;<a href="javascript:popupDetailsWindow(\'' . tep_href_link($link) . '\')">' . $products_options_name['products_options_comment'] . '</a>';
} else {
echo '&nbsp;<a href="javascript:popupDetailsWindow(\'' . tep_href_link($link) . '\')">' . TEXT_DEFAULT_OPTION_LINK_TEXT . '</a>';
}
} else {
if ( $products_options_name['products_options_comment'] != "" ) {
echo "&nbsp;" . $products_options_name['products_options_comment'];
}
}
//KIKOLEPPARD add for Unique Attribute

?></td>
</tr>
<?php
break;

case PRODUCTS_OPTIONS_TYPE_RADIO:
//CLR 030714 Add logic for radio buttons
$tmp_html = '<table>';
$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . /*KIKOLEPPARD add for Product Attribute Sort */"' order by pov.products_options_values_sort_order"/*KIKOLEPPARD add for Product Attribute Sort */);
$checked = true;
while ($products_options_array = tep_db_fetch_array($products_options_query)) {
$tmp_html .= '<tr><td class="main">';
$tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked);
$checked = false;
$tmp_html .= $products_options_array['products_options_values_name'] ;

//KIKOLEPPARD change for Actual Attribute Price
if (($products_options_array['options_values_price'] != '0')||(($products_options_array['options_values_price'] == '0')&&($products_options_array['price_prefix'] == ''))){
//KIKOLEPPARD change for Actual Attribute Price

$tmp_html .= '(' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')&nbsp';
}

$tmp_html .= '</tr></td>';
}
$tmp_html .= '</table>';
?>
<tr>
<td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
<td class="main"><?php echo $tmp_html;

//KIKOLEPPARD add for Unique Attribute

if ( $products_options_name['products_options_link'] != "" ) {
$link = DIR_WS_DETAILS . $products_options_name['products_options_link'];
if ( $products_options_name['products_options_comment'] != "" ) {
echo '&nbsp;<a href="javascript:popupDetailsWindow(\'' . tep_href_link($link) . '\')">' . $products_options_name['products_options_comment'] . '</a>';
} else {
echo '&nbsp;<a href="javascript:popupDetailsWindow(\'' . tep_href_link($link) . '\')">' . TEXT_DEFAULT_OPTION_LINK_TEXT . '</a>';
}
} else {
if ( $products_options_name['products_options_comment'] != "" ) {
echo "&nbsp;" . $products_options_name['products_options_comment'];
}
}
//KIKOLEPPARD add for Unique Attribute

?></td>
</tr>
<?php
break;
case PRODUCTS_OPTIONS_TYPE_CHECKBOX:
//CLR 030714 Add logic for checkboxes
$products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . /*KIKOLEPPARD add for Product Attribute Sort */"' order by attribute_sort"/*KIKOLEPPARD add for Product Attribute Sort */);
$products_attribs_array = tep_db_fetch_array($products_attribs_query);
echo '<tr><td class="main">' . $products_options_name['products_options_name'] . ': </td><td class="main">';
echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']);

//KIKOLEPPARD change for Actual Attribute Price
if (($products_attribs_array['options_values_price'] != '0')||(($products_attribs_array['options_values_price'] == '0')&&($products_attribs_array['price_prefix'] == ''))){
//KIKOLEPPARD change for Actual Attribute Price

echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')&nbsp';
}

//KIKOLEPPARD add for Unique Attribute
if ( $products_options_name['products_options_link'] != "" ) {
$link = DIR_WS_DETAILS . $products_options_name['products_options_link'];
if ( $products_options_name['products_options_comment'] != "" ) {
echo '&nbsp;<a href="javascript:popupDetailsWindow(\'' . tep_href_link($link) . '\')">' . $products_options_name['products_options_comment'] . '</a>';
} else {
echo '&nbsp;<a href="javascript:popupDetailsWindow(\'' . tep_href_link($link) . '\')">' . TEXT_DEFAULT_OPTION_LINK_TEXT . '</a>';
}
} else {
if ( $products_options_name['products_options_comment'] != "" ) {
echo "&nbsp;" . $products_options_name['products_options_comment'];
}
}
//KIKOLEPPARD add for Unique Attribute

echo '</td></tr>';
break;


default:
//clr 030714 default is select list
//clr 030714 reset selected_attribute variable
$selected_attribute = false;


$products_options_array = array();


// Line Change New Atributes Manger + Sort
$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.attribute_sort");
// Line Change New Atributes Manger + Sort

while ($products_options = tep_db_fetch_array($products_options_query)) {


$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);


//BOF PHPMOM.COM AAP
if (($products_options['options_values_price'] != '0')||(($products_options['options_values_price'] == '0')&&($products_options['price_prefix'] == ''))) {
//EOF PHPMOM.COM AAP
//Attribute suite end

find:

<td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
</tr>
<?php
}
?>
</table>
<?php
}

and replace with:

<?php
//Attribute suite start
?>
<!-- unique attributes -->
<td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?>
<?php
if ( $products_options_name['products_options_link'] != "" ) {
$link = DIR_WS_DETAILS . $products_options_name['products_options_link'];
if ( $products_options_name['products_options_comment'] != "" ) {
echo '&nbsp;<a href="javascript:popupDetailsWindow(\'' . tep_href_link($link) . '\')">' . $products_options_name['products_options_comment'] . '</a>';
} else {
echo '&nbsp;<a href="javascript:popupDetailsWindow(\'' . tep_href_link($link) . '\')">' . TEXT_DEFAULT_OPTION_LINK_TEXT . '</a>';
}
} else {
if ( $products_options_name['products_options_comment'] != "" ) {
echo "&nbsp;" . $products_options_name['products_options_comment'];
}
}
?>
</td>
<!-- unique attributes -->
<?php
} //clr 030714 end switch
} //clr 030714 end while

?>
</table>
<?php
} //clr 030714 end if
//Attribute suite end

STEP 17. In catalog/includes/boxes/whats_new.php

find:

$whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));

and replace with:

//Attribute suite start
//$whats_new_price = $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id']));
// Start "Hide Price if $0" edit 1 of 1 (uncomment above line if removing this contribution)
$whats_new_price = (($random_product['products_price'] > 0) ? $currencies->display_price($random_product['products_price'], tep_get_tax_rate($random_product['products_tax_class_id'])) : '');
// End "Hide Price if $0" edit 1 of 1
//Attribute suite end


STEP 18. In catalog/includes/classes/order.php


find:

$this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
'value' => $attributes['products_options_values_name'],

and replace with:

//Attribute suite start
//clr 030714 Determine if attribute is a text attribute and change products array if it is.
if ($value == PRODUCTS_OPTIONS_VALUE_TEXT_ID){
$attr_value = $products[$i]['attributes_values'][$option];
} else {
$attr_value = $attributes['products_options_values_name'];
}
$this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'],
'value' => $attr_value,
//Attribute suite end


STEP 19. In catalog/includes/classes/shopping_cart.php

find:

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')");

and replace with:

while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
//Attribute suite start
//clr 031714 udate query to include attribute value. This is needed for text attributes.
$attr_value = $this->contents[$products_id]['attributes_values'][$option];
tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "', '" . tep_db_input($attr_value) . "')");
//Attribute suite end

find:

$attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");
while ($attributes = tep_db_fetch_array($attributes_query)) {
$this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id'];

and replace with:

//Attribute suite start
//CLR 020606 update query to pull attribute value_text. This is needed for text attributes.
$attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'");

while ($attributes = tep_db_fetch_array($attributes_query)) {
$this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id'];

//CLR 020606 if text attribute, then set additional information
if ($attributes['products_options_value_id'] == PRODUCTS_OPTIONS_VALUE_TEXT_ID) {
$this->contents[$products['products_id']]['attributes_values'][$attributes['products_options_id']] = $attributes['products_options_value_text'];
}
//Attribute suite end

find:

$this->contents[$products_id]['attributes'][$option] = $value;
// update database
if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");

and replace with:

//Attribute suite start
//CLR 020606 check if input was from text box. If so, store additional attribute information
//CLR 020708 check if text input is blank, if so do not add to attribute lists
//CLR 030228 add htmlspecialchars processing. This handles quotes and other special chars in the user input.
$attr_value = NULL;
$blank_value = FALSE;
if (strstr($option, TEXT_PREFIX)) {
if (trim($value) == NULL)
{
$blank_value = TRUE;
} else {
$option = substr($option, strlen(TEXT_PREFIX));
$attr_value = htmlspecialchars(stripslashes($value), ENT_QUOTES);
$value = PRODUCTS_OPTIONS_VALUE_TEXT_ID;
$this->contents[$products_id]['attributes_values'][$option] = $attr_value;
}
}

if (!$blank_value)
{
$this->contents[$products_id]['attributes'][$option] = $value;
// insert into database
//CLR 020606 update db insert to include attribute value_text. This is needed for text attributes.
//CLR 030228 add tep_db_input() processing
if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "', '" . tep_db_input($attr_value) . "')");
}
//Attribute suite end

find:

$this->contents[$products_id]['attributes'][$option] = $value;
// insert into database
if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')");

and replace with:

//Attribute suite start
//CLR 020606 check if input was from text box. If so, store additional attribute information
//CLR 030108 check if text input is blank, if so do not update attribute lists
//CLR 030228 add htmlspecialchars processing. This handles quotes and other special chars in the user input.
$attr_value = NULL;
$blank_value = FALSE;
if (strstr($option, TEXT_PREFIX)) {
if (trim($value) == NULL)
{
$blank_value = TRUE;
} else {
$option = substr($option, strlen(TEXT_PREFIX));
$attr_value = htmlspecialchars(stripslashes($value), ENT_QUOTES);
$value = PRODUCTS_OPTIONS_VALUE_TEXT_ID;
$this->contents[$products_id]['attributes_values'][$option] = $attr_value;
}
}

if (!$blank_value)
{
$this->contents[$products_id]['attributes'][$option] = $value;
// update database
//CLR 020606 update db insert to include attribute value_text. This is needed for text attributes.
//CLR 030228 add tep_db_input() processing
if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "', products_options_value_text = '" . tep_db_input($attr_value) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
}
//Attribute suite end

after:

}

function remove($products_id) {
global $customer_id;

add this:


//Attribute suite start
//CLR 030228 add call tep_get_uprid to correctly format product ids containing quotes
$products_id = tep_get_uprid($products_id, $attributes);
//Attribute suite end

find:

// attributes price
if (isset($this->contents[$products_id]['attributes'])) {
reset($this->contents[$products_id]['attributes']);
while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
$attribute_price = tep_db_fetch_array($attribute_price_query);
if ($attribute_price['price_prefix'] == '+') {
$this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
} else {
$this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
}
}
}
}
}

function attributes_price($products_id) {
$attributes_price = 0;

if (isset($this->contents[$products_id]['attributes'])) {
reset($this->contents[$products_id]['attributes']);
while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
$attribute_price = tep_db_fetch_array($attribute_price_query);
if ($attribute_price['price_prefix'] == '+') {
$attributes_price += $attribute_price['options_values_price'];
} else {
$attributes_price -= $attribute_price['options_values_price'];
}
}
}

return $attributes_price;
}

and replace with:

//Attribute suite start
// phpmom.com advanced attribute price
if (isset($this->contents[$products_id]['attributes'])) {
reset($this->contents[$products_id]['attributes']);
while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$prid . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
$attribute_price = tep_db_fetch_array($attribute_price_query);
if ($attribute_price['price_prefix'] == '+') {
$this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
} elseif ($attribute_price['price_prefix'] == '-') {
$this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
}
elseif ($attribute_price['price_prefix'] == '')
{ //comment where you see //'0' if want '0' value
// if ($attribute_price['options_values_price'] == '0') { //'0'
// $this->total += 0; //'0'
// } //'0'

// if ($attribute_price['options_values_price'] != '0') { //'0'
$this->total += tep_add_tax($attribute_price['options_values_price'], $products_tax) * $qty - (tep_add_tax($products_price, $products_tax) * $qty);

// }//'0'
}else $this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
}
}
}
}
//PHPMOM.COM AAP end

//PHPMOM.COM AAP
function attributes_price($products_id) {
$attributes_price = 0;

if (isset($this->contents[$products_id]['attributes'])) {
reset($this->contents[$products_id]['attributes']);
while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
$attribute_price = tep_db_fetch_array($attribute_price_query);
if ($attribute_price['price_prefix'] == '+') {
$attributes_price += $attribute_price['options_values_price'];
} elseif ($attribute_price['price_prefix'] == '-') {
$attributes_price -= $attribute_price['options_values_price'];
}
else
$attributes_price+= $attribute_price['options_values_price'];
}
}

return $attributes_price;
}
//PHPMOM.COM AAP end
//Attribute suite end

after:

$specials = tep_db_fetch_array($specials_query);
$products_price = $specials['specials_new_products_price'];
}

add this:

//Attribute suite start
//BOF PHPMOM.COM AAP//hadir
$attributes_price = 0;

if (isset($this->contents[$products_id]['attributes'])) {
reset($this->contents[$products_id]['attributes']);
while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
$attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
$attribute_price = tep_db_fetch_array($attribute_price_query);
if ($attribute_price['price_prefix'] == '') {
$attributes_price += ($attribute_price['options_values_price']-$products_price);
} elseif ($attribute_price['price_prefix'] == '+') {
$attributes_price += $attribute_price['options_values_price'];
}
elseif ($attribute_price['price_prefix'] == '-') {
$attributes_price -= $attribute_price['options_values_price'];
}
}
} //PHPMOM.COM AAP end//hadir
//Attribute suite end

find:

'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));

replace with :

//Attribute suite start
//clr 030714 update $products_array to include attribute value_text. This is needed for text attributes.
'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''),
'attributes_values' => (isset($this->contents[$products_id]['attributes_values']) ? $this->contents[$products_id]['attributes_values'] : ''));
//Attribute suite end


STEP 20. In catalog/includes/functions/general.php


find:

$uprid = $uprid . '{' . $option . '}' . $value;
}
}
return $uprid;
}

and replace with:

//Attribute suite start
//CLR 030714 Add processing around $value. This is needed for text attributes.
$uprid = $uprid . '{' . $option . '}' . htmlspecialchars(stripslashes(trim($value)), ENT_QUOTES);
}
//CLR 030228 Add else stmt to process product ids passed in by other routines.
} else {
$uprid = htmlspecialchars(stripslashes($uprid), ENT_QUOTES);
}
$uprid = $uprid . '{' . $option . '}' . $value;
}
return $uprid;
}
//Attribute suite end

after:

function tep_convert_linefeeds($from, $to, $string) {
if ((PHP_VERSION < "4.0.5") && is_array($from)) {
return ereg_replace('(' . implode('|', $from) . ')', $to, $string);
} else {
return str_replace($from, $to, $string);
}
}

add this:

//Attribute suite start
//CLR 030228 Add function tep_decode_specialchars
// Decode string encoded with htmlspecialchars()
function tep_decode_specialchars($string){
$string=str_replace('&gt;', '>', $string);
$string=str_replace('&lt;', '<', $string);
$string=str_replace('&#039;', "'", $string);
$string=str_replace('&quot;', "\"", $string);
$string=str_replace('&amp;', '&', $string);

return $string;
}
//Attribute suite end


STEP 21. In catalog/includes/modules/new_products.php

find:

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

and replace with:

//Attribute suite start
//'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));
// Start "Hide Price if $0" edit 1 of 1 (uncomment above line if removing this contribution)
'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . (($new_products['products_price'] > 0) ? $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) : ''));
// End "Hide Price if $0" edit 1 of 1
//Attribute suite end


STEP 22. In catalog/includes/modules/product_listing.php


find:

$lc_text = '&nbsp;' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '&nbsp;';
}

and replace with:

//Attribute suite start
//$lc_text = '&nbsp;' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '&nbsp;';
// Start "Hide Price if $0" edit 1 of 2 (uncomment above line if removing this contribution)
$lc_text = '&nbsp;' . (($listing['products_price'] > 0) ? $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) : '') . '&nbsp;';
// End "Hide Price if $0" edit 1 of 2
//Attribute suite start
}

STEP 23. Add this in catalog/includes/languages/english/product_info.php


//Attribute suite start
//unique attribute
define('TEXT_DEFAULT_OPTION_LINK_TEXT', '(Click for details)');
//unique attribute
//Attribute suite end


And that it's :)

 

Go to the mainpage